<html>

	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="../../../Themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../../../Themes/icon.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/demo.css">
		<script type="text/javascript" src="../../../JS/jquery.min.js"></script>
		<script type="text/javascript" src="../../../JS/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="../../../JS/common.js"></script>
	</head>

	<body style="padding: 0px;">
		<div class="easyui-layout" style="width:100%;height:600px;">
			<div data-options="region:'center'">
				<table id="dg" style="width:100%;">
				</table>
			</div>
		</div>
		<div id="toolbar"></div>
		<div id="dlg" class="hiddenDialog">
			<iframe id="ifrmEdit" style="width: 100%;height: 100%;" frameborder="0" scrolling="no"></iframe>
		</div>
		</div>
	</body>
	<script>
		var content = "";
		var AddDialog;
		content = AddToolBar(63);
		$("#toolbar").append(content);
		var dialogWidth = 850;
		var dialogHeight = 500;
		var currid = getMultiID();
		var listUrl = "";
		if(currid != undefined) {
			listUrl = RemoteLinkAddress + "/market/charge/list.do?" + constructSpecialCondition(currid);
		} else {
			listUrl = RemoteLinkAddress + "/market/charge/list.do";
		}
		function redodata(){
			checkAllData("/market/charge/list.do");
		}
		
		$("#dg").datagrid({
			url: listUrl,
			toolbar: '#toolbar',
			method: 'get',
			pagination: 'true',
			rownumbers: 'true',
			fitColumns: 'false',
			singleSelect: 'true',
			height: 350,
			columns: [
				[{
					field: 'ID',
					title: 'ID',
					width: '5%',
					align: 'center',
				}, {
					field: 'ORDER_NO',
					title: '编号',
					width: '19%',
					align: 'center',
				}, {
					field: 'TENANT_NAME',
					title: '姓名',
					width: '15%',
					align: 'center',
				}, {
					field: 'TENANT_TYPE',
					title: '客户类型',
					width: '15%',
					align: 'center',
					formatter: function(value, row, index) {
						switch(value) {
							case "0":
								return "市场人员";
							case "1":
								return "非市场人员";
						}
					}
				}, {
					field: 'IDCARD',
					title: '身份证号码',
					width: '25%',
					align: 'center',
				}, {
					field: 'COST',
					title: '费用',
					width: '12%',
					align: 'center',
					formatter: function(value, row, index) {
						if(value) {
							return "￥" + value;
						}
					}
				}, {
					field: 'ISVERIFY',
					title: '审核状态',
					width: '10%',
					align: 'center',
					formatter: function(value, row, index) {
						return verifyStatus(value, false);
					}
				}]
			],
			onDblClickRow: function(index, row) {
				var pLocation = "UI/Market/Receipt/receiptAdd.html?ID=" + row.ID;
				AddTabIn("收费详细信息", parent.parent.$("#tabs"), pLocation);
			}
		});

		$("#dg").datagrid('hideColumn', 'ID');

		function newdata() {
			var pLocation = "UI/Market/Receipt/receiptAdd.html?id=-1";
			$("#ifrmEdit").attr("src", pLocation);
			AddTabIn("添加收据", parent.parent.$("#tabs"), pLocation);
		}

		function editdata() {
			var pLocation = "";
			var row = $('#dg').datagrid('getSelected');
			if(!row) {
				$.messager.alert('提示', "请选择你需要修改数据");
			}
			pLocation = "UI/Market/Receipt/receiptAdd.html?id=" + row.id;
			$("#ifrmEdit").attr("src", pLocation);
			AddTabIn("添加收据", parent.parent.$("#tabs"), pLocation);
		}

		function print() {
			//			var row = $('#dg').datagrid('getSelected');
			//			if (!row) {
			//				$.messager.alert('Info', "没有选中");
			//			}
			//			var pLocation = "receiptPrint.html?id=" + row.id;
			var pLocation = "receiptPrint.html";
			window.open(pLocation);
		}

		function destroy() {
			var address = "market/tenant/delete.do";
			CreateDestroy($("#dg"), address);
		}
	</script>

</html>